#!/bin/bash

# postinst script for kbd
#
# see: dh_installdeb(1)

#set -e

# summary of how this script can be called:
#        * <postinst> \`configure' <most-recently-configured-version>
#        * <old-postinst> \`abort-upgrade' <new version>
#        * <conflictor's-postinst> \`abort-remove' \`in-favour' <package>
#          <new-version>
#        * <postinst> \`abort-remove'
#        * <deconfigured's-postinst> \`abort-deconfigure' \`in-favour'
#          <failed-install-package> <version> \`removing'
#          <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package

PATH=/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
export PATH

if [ "${BASEDIR:=/}" = "/" ]; then
    BASEDIR=""
else
    BASEDIR_OPT="-b $BASEDIR"
fi

case "$1" in
    configure)
        chown root:bin $BASEDIR/usr/share/lib/keytables
	chown root:bin $BASEDIR/usr/share/lib/keytables/type_101
	chown root:bin $BASEDIR/usr/share/lib/keytables/type_6
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_101/canadian_french2"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_101/canadian_french2"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_101/czech"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_101/czech"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_101/denmark"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_101/denmark"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_101/france"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_101/france"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_101/germany"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_101/germany"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_101/greece"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_101/greece"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_101/hungary"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_101/hungary"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_101/italy"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_101/italy"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_101/j3100"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_101/j3100"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_101/japan"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_101/japan"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_101/korea"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_101/korea"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_101/latvia"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_101/latvia"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_101/lithuania"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_101/lithuania"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_101/netherlands"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_101/netherlands"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_101/norway"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_101/norway"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_101/poland"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_101/poland"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_101/portugal"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_101/portugal"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_101/reset"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_101/reset"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_101/russia"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_101/russia"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_101/spain"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_101/spain"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_101/sweden"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_101/sweden"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_101/swiss_french"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_101/swiss_french"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_101/swiss_german"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_101/swiss_german"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_101/traditional_chinese"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_101/traditional_chinese"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_101/turkey"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_101/turkey"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_101/uk"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_101/uk"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_101/us"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_101/us"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/albania"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/albania"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/arabia"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/arabia"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/belarus"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/belarus"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/belgium"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/belgium"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/brazil"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/brazil"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/bulgaria"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/bulgaria"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/canadian_bilingual"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/canadian_bilingual"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/canadian_french"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/canadian_french"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/croatia"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/croatia"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/czech"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/czech"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/denmark"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/denmark"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/dvorak"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/dvorak"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/estonia"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/estonia"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/finnish"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/finnish"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/france"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/france"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/germany"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/germany"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/greece"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/greece"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/hungary"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/hungary"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/iceland"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/iceland"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/italy"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/italy"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/japan"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/japan"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/kbd_layouts"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/kbd_layouts"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/korea"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/korea"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/latinamerica"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/latinamerica"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/latvia"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/latvia"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/lithuania"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/lithuania"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/macedonia"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/macedonia"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/maltauk"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/maltauk"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/maltaus"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/maltaus"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/netherlands"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/netherlands"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/norway"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/norway"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/poland"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/poland"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/portugal"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/portugal"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/reset"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/reset"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/romania"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/romania"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/russia"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/russia"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/serbiaandmontenegro"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/serbiaandmontenegro"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/slovakia"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/slovakia"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/slovenia"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/slovenia"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/spain"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/spain"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/sweden"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/sweden"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/swiss_french"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/swiss_french"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/swiss_german"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/swiss_german"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/traditional_chinese"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/traditional_chinese"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/turkeyf"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/turkeyf"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/turkeyq"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/turkeyq"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/uk"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/uk"
	chmod 0444 "$BASEDIR/usr/share/lib/keytables/type_6/us"
	chown root:bin "$BASEDIR/usr/share/lib/keytables/type_6/us"
	chmod 0555 "$BASEDIR/lib/svc/method/keymap"
	chown root:bin "$BASEDIR/lib/svc/method/keymap"
	chmod 0555 "$BASEDIR/usr/bin/dumpkeys"
	chown root:bin "$BASEDIR/usr/bin/dumpkeys"
	chmod 0555 "$BASEDIR/usr/bin/loadkeys"
	chown root:bin "$BASEDIR/usr/bin/loadkeys"
	chmod 0555 "$BASEDIR/usr/lib/set_keyboard_layout"
	chown root:bin "$BASEDIR/usr/lib/set_keyboard_layout"
	chmod 0444 "$BASEDIR/lib/svc/manifest/system/keymap.xml"
	chown root:sys "$BASEDIR/lib/svc/manifest/system/keymap.xml"
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
    ;;

    *)
        echo "postinst called with unknown argument '$1'" >&2
        exit 1
    ;;
esac



# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0

